package com.arpa.oms.domain.entity;

import com.arpa.wms.domain.entity.BasicEntity;
import com.baomidou.mybatisplus.annotation.TableField;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.Digits;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.math.BigDecimal;

/**
 * <p>
 * OMS采购退货明细
 * </p>
 *
 * @author LEO
 * @since 2020-11-17
 */
@Data
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@ApiModel(value="OmsPurchaseReturnItem对象", description="OMS采购退货明细")
public class OmsPurchaseReturnItem extends BasicEntity {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "数据标识")
    @TableField("code")
    private String code;

    @ApiModelProperty(value = "退货单号",hidden = true)
    @TableField("purchase_return_code")
    private String purchaseReturnCode;

    @ApiModelProperty(value = "采购商品来源code",required = true)
    @NotEmpty(message = "采购商品来源code不能为空")
    @TableField("source_item_code")
    private String sourceItemCode;

    @ApiModelProperty(value = "商品标识",required = true)
    @NotEmpty(message = "商品标识不能为空")
    @TableField("goods_code")
    private String goodsCode;

    @ApiModelProperty(value = "商品编码",required = true)
    @NotEmpty(message = "商品编码不能为空")
    @TableField("good_code")
    private String goodCode;

    @ApiModelProperty(value = "商品条码",required = true)
    @NotEmpty(message = "商品条码不能为空")
    @TableField("goods_bar_code")
    private String goodsBarCode;

    @ApiModelProperty(value = "商品名称",required = true)
    @NotEmpty(message = "商品名称不能为空")
    @TableField("goods_name")
    private String goodsName;

    @ApiModelProperty(value = "商品规格")
    @TableField("spec")
    private String spec;

    @ApiModelProperty(value = "商品保质期(天)")
    @TableField("expiration_quantity")
    private BigDecimal expirationQuantity;

    @ApiModelProperty(value = "商品基本单位",required = true)
    @TableField("basic_unit")
    @NotEmpty(message = "商品基本单位不能为空")
    private String basicUnit;

    @ApiModelProperty(value = "基本单位名称",required = true)
    @TableField("basic_unit_name")
    @NotEmpty(message = "商品基本单位名称不能为空")
    private String basicUnitName;

    @ApiModelProperty(value = "当前商品单位转基本单位件装量",required = true)
    @TableField("unit_convert_quantity")
    @NotNull(message = "当前商品单位转基本单位件装量不能为空")
    private BigDecimal unitConvertQuantity;

    @ApiModelProperty(value = "退货单位",required = true)
    @TableField("return_unit")
    @NotEmpty(message = "退货单位不能为空")
    private String returnUnit;

    @ApiModelProperty(value = "退货单位名称",required = true)
    @TableField("return_unit_name")
    @NotEmpty(message = "退货单位名称不能为空")
    private String returnUnitName;

    @ApiModelProperty(value = "计划退货数量（退货单位）",required = true)
    @Digits(integer = 14,fraction = 6)
    @TableField("plan_quantity")
    @NotNull(message = "计划退货数量不能为空")
    private BigDecimal planQuantity;

    @ApiModelProperty(value = "计划退货数量（基本单位）",hidden = true)
    @TableField("plan_basic_quantity")
    private BigDecimal planBasicQuantity;
    @ApiModelProperty(value = "实际退货数量（退货单位）",hidden = true)
    @TableField("actual_quantity")
    private BigDecimal actualQuantity;
    @ApiModelProperty(value = "实际退货数量（基本单位）",hidden = true)
    @TableField("actual_basic_quantity")
    private BigDecimal actualBasicQuantity;

    @ApiModelProperty(value = "税率",required = true)
    @TableField("tax_rate")
    @Digits(integer = 14,fraction = 6)
    @NotNull(message = "税率不能为空")
    private BigDecimal taxRate;

    @ApiModelProperty(value = "单价",required = true)
    @TableField("unit_price")
    @Digits(integer = 14,fraction = 6)
    @NotNull(message = "单价不能为空")
    private BigDecimal unitPrice;

    @ApiModelProperty(value = "含税单价",required = true)
    @TableField("tax_unit_price")
    @Digits(integer = 14,fraction = 6)
    @NotNull(message = "含税单价不能为空")
    private BigDecimal taxUnitPrice;

    @ApiModelProperty(value = "金额",required = true)
    @TableField("amount_money")
    @Digits(integer = 14,fraction = 6)
    @NotNull(message = "金额不能为空")
    private BigDecimal amountMoney;

    @ApiModelProperty(value = "税额",required = true)
    @TableField("tax_money")
    @Digits(integer = 14,fraction = 6)
    @NotNull(message = "税额不能为空")
    private BigDecimal taxMoney;

    @ApiModelProperty(value = "价税合计",required = true)
    @TableField("total_money")
    @Digits(integer = 14,fraction = 6)
    @NotNull(message = "价税合计不能为空")
    private BigDecimal totalMoney;

    @ApiModelProperty(value = "备注")
    @TableField("remarks")
    @Length(max = 100, message = "备注最多输入100个字符")
    private String remarks;


}
